package cn.janus.response;


import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BillExceptionHandler {
    @ExceptionHandler(BindException.class)
    public Result BindExceptionHandler(BindException bindException) {
        return Result.fail(bindException.getAllErrors().get(0).getDefaultMessage());
    }
}
